﻿function getResult(url) {
    var result = window.showModalDialog(url, "window", "dialogHeight:300px;dialogWidth:370px;location:yes;menubar:no;toolbar:no;status:no;center:yes;help:no;status:no;");
    if (typeof (result) == 'undefined') {
        result = window.ReturnValue;
        if (typeof (result) == 'undefined')
            result = "";
    }
    return result;
}
function OpenWindowAndSetElement(url, controlid, hiddenid, width, height) {
    //var id = document.getElementById(controlid);
    var size = "dialogHeight:" + height + "px;dialogWidth:" + width + "px;location:yes;menubar:no;toolbar:no;status:no;center:yes;help:no;status:no;";
    var result = window.showModalDialog(url, "window", size);
    if (typeof (result) == 'undefined') {
        result = window.ReturnValue;
        if (typeof (result) == 'undefined')
            result = "";
    }
    var arr = result.split('|');
    if (arr.length > 1) {

        controlid.value = arr[0];
        if (hiddenid != "")
            hiddenid.value = arr[1];
    }
    else {

        controlid.value = "";
        if (hiddenid != "")
            hiddenid.value = "";
    }
}